/*!
    \copyright  Copyright (c) 2020 - 2023 Qualcomm Technologies International, Ltd.\n
                All Rights Reserved.\n
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \file
    \addtogroup usb_audio
    \brief      Header file for creating descriptors for USB Audio class 1.0 
*/

#ifndef USB_AUDIO_CLASS_10_DESCRIPTORS_H_
#define USB_AUDIO_CLASS_10_DESCRIPTORS_H_

#include "usb_audio_defines.h"
#include "usb_audio_class_defines.h"

/*! \brief Endpoint Control Selectors */
typedef enum
{
    UAC_EP_CONTROL_UNDEFINED        = 0x00,
    UAC_EP_CONTROL_SAMPLING_FREQ    = 0x01,
    UAC_EP_CONTROL_PITCH            = 0x02,
    UAC_EP_CONTROL_MAX_PACKETS_ONLY = 0x80
} usb_audio_endpoint_control_selectors_t;

/*! To get Class-Specific AC Interface Header Descriptor length from interface count */
#define UAC_AC_IF_HEADER_DESC_SIZE(if_count)     (8+(if_count))

/*! To get Input Terminal Descriptor length */
#define UAC_IT_TERM_DESC_SIZE                    (0x0C)

/*! To get Output Terminal Descriptor length*/
#define UAC_OT_TERM_DESC_SIZE                    (0x09)

/*! To get Feature Unit Descriptor length from channel count and control size */
#define UAC_FU_DESC_SIZE(ch_count, control_size) (0x07+(ch_count+1)*control_size)

/*! To get Class-Specific AS Interface Descriptor length */
#define UAC_AS_IF_DESC_SIZE                      (0x07)

/*! To get Type I Format Type Descriptor length from number of sampling frequencies supported*/
#define UAC_FORMAT_DESC_SIZE(n_s)                (0x08 + (n_s)*3)

/*! To get Class-Specific AS Isochronous Audio Data Endpoint Descriptor length */
#define UAC_AS_DATA_EP_DESC_SIZE                 (0x07)


#endif /* USB_AUDIO_CLASS_10_DESCRIPTORS_H_ */

/*! @} */
